
const {ccclass, property} = cc._decorator;

@ccclass
export default class Player extends cc.Component {
    @property(cc.Node)
    star1:cc.Node = null;
    @property(cc.Node)
    star2:cc.Node = null;
    setMoving(moving) {
        if (moving) {
            this.star1.rotation = 4;
            this.star2.rotation = -4;
        } else {
            this.star1.rotation = 3;
            this.star2.rotation = -3;
        }
    };
    
    onCollisionEnter (other, self) {
        console.log("onCollisionEnter");
        this.node.x = self.world.preAabb.x;
        this.node.y = self.world.preAabb.y;
    };
    
    onCollisionStay (other, self) {
        console.log("onCollisionStay");
    };
    
    onCollisionExit (other) {
        console.log("onCollisionExit");
    };
}
